package org.jeecg.modules.tls.blog.tag.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.tls.blog.article.entity.BlogArticle;
import org.jeecg.modules.tls.blog.article.vo.ArticleDetailVo;
import org.jeecg.modules.tls.blog.blogarticletag.entity.BlogArticleTag;
import org.jeecg.modules.tls.blog.blogarticletag.service.IBlogArticleTagService;
import org.jeecg.modules.tls.blog.category.entity.BlogCategory;
import org.jeecg.modules.tls.blog.common.ResponseResult;
import org.jeecg.modules.tls.blog.tag.entity.BlogTag;
import org.jeecg.modules.tls.blog.tag.mapper.BlogTagMapper;
import org.jeecg.modules.tls.blog.tag.service.IBlogTagService;
import org.jeecg.modules.tls.blog.tag.vo.TagVo;
import org.jeecg.modules.tls.blog.utils.BeanCopyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @Description: blog_tag
 * @Author: jeecg-boot
 * @Date:   2023-01-09
 * @Version: V1.0
 */
@Service
public class BlogTagServiceImpl extends ServiceImpl<BlogTagMapper, BlogTag> implements IBlogTagService {

    @Autowired
    private IBlogArticleTagService blogArticleTagService;

    @Override
    public ResponseResult tagList() {

        QueryWrapper<BlogTag> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("id","name");
        List<BlogTag> tagList = list(queryWrapper);

        //封装vo
        List<TagVo> tagVo = BeanCopyUtils.copyBeanList(tagList, TagVo.class);
        return ResponseResult.okResult(tagVo);
    }
}
